package com.tantinevincent.formatter;

import com.tantinevincent.vector.IVector;

public class CsvFormatter implements IFormatter{
	/**
	 * {@inheritDoc}
	 */
	@Override
	public String format(IVector v,int label) {
		StringBuilder sb = new StringBuilder(label);
		for( int i=0; i<=v.length()-1; i++ ){
			double value = v.get(i);
			sb.append(',');
			sb.append(value);
		}
		return sb.toString();
	}
	@Override
	public String toString(){
		return "CSV Formatter, first colmun is label";
	}
}
